package htu.mapper;

import htu.entity.MyBatisUser;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface MyBatisUserDao {
    //查询操作
//    @Select("select * from user")
    List<MyBatisUser> selectAllUser();
    //新增操作
//    @Insert("insert into user values(#{id},#{name},#{phone})")
    void insertUser(MyBatisUser myBatisUser);
    //修改操作
//    @Update("update user set name=#{name},phone=#{phone} where id =#{id}")
    void updateUser(MyBatisUser myBatisUser);
    //删除操作
//    @Delete("delete from user where id = #{id}")
    void deleteUser(MyBatisUser myBatisUser);
    //动态sql，实现一种操作
    void SQLinsertUser(MyBatisUser myBatisUser);
    //动态SQL，实现批量操作
    void SQLupdateUser(List<MyBatisUser> list);
}
